import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  { path: '/login', component: () => import('@/views/Login/index.vue') },
  {
    path: '/',
    component: () => import('@/views/Layout/index.vue'),
    redirect: '/home',
    children: [
      {
        path: '/home',
        component: () => import('@/views/Home/index.vue')
      },
      {
        path: '/article',
        component: () => import('@/views/Article/index.vue')
      },
      {
        path: '/message',
        component: () => import('@/views/Message/index.vue')
      },
      { path: '/users', component: () => import('@/views/Users/index.vue') }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: routes
})

export default router
